package routers

import (
	beego "github.com/beego/beego/v2/server/web"
	"news_sys/controllers"
)

func init() {
	beego.Router("/", &controllers.MainController{})
	beego.Router("/user/login", &controllers.UserController{}, "POST:Login;OPTIONS:Login")
	beego.Router("/type/add", &controllers.TypeController{}, "POST:Create;OPTIONS:Create")
	beego.Router("/news/add", &controllers.NewsController{}, "POST:Create;OPTIONS:Create")
	beego.Router("/news/image/add", &controllers.NewsController{}, "POST:CreateImage;OPTIONS:CreateImage")
	beego.Router("/news/list", &controllers.NewsController{}, "GET:List;OPTIONS:List")
	beego.Router("/news/del", &controllers.NewsController{}, "POST:Del;OPTIONS:Del")
	beego.Router("/news/data", &controllers.NewsController{}, "Get:Find;OPTIONS:Find")
}
